package edu.uwm.cs552;

import java.awt.Dimension;
import java.awt.LayoutManager;
import java.awt.Rectangle;

import javax.swing.JPanel;
import javax.swing.Scrollable;
import javax.swing.SwingConstants;

public abstract class TopographyBoardPanel extends JPanel implements Scrollable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public TopographyBoardPanel() {
		super();
	}

	public TopographyBoardPanel(LayoutManager layout) {
		super(layout);
	}

	public TopographyBoardPanel(boolean isDoubleBuffered) {
		super(isDoubleBuffered);
	}

	public TopographyBoardPanel(LayoutManager layout, boolean isDoubleBuffered) {
		super(layout, isDoubleBuffered);
	}

	public Dimension getPreferredScrollableViewportSize() {
		return getPreferredSize();
	}

	public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation,
			int direction) {
				if (orientation == SwingConstants.HORIZONTAL) {
					return visibleRect.width - getScrollableUnitIncrement(visibleRect,orientation,direction);
				} else {
					return visibleRect.height - getScrollableUnitIncrement(visibleRect,orientation,direction);
				}
			}

	public boolean getScrollableTracksViewportHeight() {
		return false;
	}

	public boolean getScrollableTracksViewportWidth() {
		return false;
	}
	
	public abstract int getScrollableUnitIncrement(Rectangle arg0, int orientation, int direction);
	
	
	public abstract void resize();

}